<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">

    <link rel="stylesheet" href="ElementUI/index.css">

    <title>Document</title>
    <style>

        /*找到html标签、body标签，和挂载的标签,都给他们统一设置样式*/
        html, body, #app, .el-container {
            /*设置内部填充为0，几个布局元素之间没有间距*/
            padding: 0px;
            /*外部间距也是如此设置*/
            margin: 0px;
            /*统一设置高度为100%*/
            height: 100%;
        }

        .el-header {
            background-color: lightpink;
            color: #333;
            text-align: right;
            line-height: 60px;
        }

        .el-footer {
            background-color: skyblue;
            color: #333;
            text-align: center;
            line-height: 60px;
        }


        .el-aside {
            background-color: #D3DCE6;
            color: #333;
            text-align: center;
            line-height: 200px;
        }

        .el-main {
            background-color: #E9EEF3;
            color: #333;
            text-align: center;
            /*line-height: 60px;*/
        }

        body > .el-container {
            margin-bottom: 40px;
        }

        .el-container:nth-child(5) .el-aside,
        .el-container:nth-child(6) .el-aside {
            line-height: 260px;
        }

        .el-container:nth-child(7) .el-aside {
            line-height: 320px;
        }

        .el-dropdown-link {
            cursor: pointer;
            color: #409EFF;
        }

        .el-icon-arrow-down {
            font-size: 12px;
        }
    </style>

</head>

<body>
<div id="app">
    <el-container>
        <!--侧栏-->
        <el-aside>
            <el-menu>
                <el-submenu index="1">
                    <template slot="title">
                        <i class="el-icon-location"></i>
                        <span>导航一</span>
                    </template>
                    <el-menu-item-group>
                        <el-menu-item index="1-1">选项1</el-menu-item>
                        <el-menu-item index="1-2">选项2</el-menu-item>
                    </el-menu-item-group>
                    <el-menu-item index="1-3">选项3</el-menu-item>
                    </el-menu-item-group>
                    <el-submenu index="1-4">
                        <template slot="title">选项4</template>
                        <el-menu-item index="1-4-1">选项1</el-menu-item>
                    </el-submenu>
                </el-submenu>
                <el-menu-item index="2">
                    <i class="el-icon-menu"></i>
                    <span slot="title">导航二</span>
                </el-menu-item>
                <el-menu-item index="3">
                    <i class="el-icon-document"></i>
                    <span slot="title">导航三</span>
                </el-menu-item>
                <el-menu-item index="4">
                    <i class="el-icon-setting"></i>
                    <span slot="title">导航四</span>
                </el-menu-item>
            </el-menu>
        </el-aside>
        <el-container>
            <!--头部-->
            <el-header>
                <el-dropdown>
  <span class="el-dropdown-link">
    Admin<i class="el-icon-arrow-down el-icon--right"></i>
  </span>
                    <el-dropdown-menu slot="dropdown">
                        <el-dropdown-item>修改密码</el-dropdown-item>
                        <el-dropdown-item divided>退出</el-dropdown-item>
                    </el-dropdown-menu>
                </el-dropdown>
            </el-header>
            <!--主体-->
            <el-main>
                <template>
                    <el-table :data="tableData" border style="width: 100%">

                        <el-table-column fixed prop="date" label="日期" width="200"></el-table-column>

                        <el-table-column prop="name" label="姓名" width="200"></el-table-column>

                        <el-table-column prop="province" label="省份" width="200"></el-table-column>

                        <el-table-column prop="city" label="市区" width="200"></el-table-column>

                        <el-table-column prop="address" label="地址" width="300"></el-table-column>

                        <el-table-column prop="zip" label="邮编" width="200"></el-table-column>

                        <el-table-column fixed="right" label="操作" width="200" style="text-align: center">
                            <template slot-scope="scope">

                                    <el-button type="primary" @click="edit(scope)" size="medium" round >编辑</el-button>
                                    <el-button type="danger" round size="medium">删除</el-button>
                            </template>
                        </el-table-column>
                    </el-table>

                    <el-pagination
                            background
                            @size-change="handleSizeChange"
                            @current-change="handleCurrentChange"
                            :current-page="currentPage"
                            :page-sizes="[100, 200, 300, 400]"
                            :page-size="100"
                            layout="total, sizes, prev, pager, next, jumper"
                            :total="400">
                    </el-pagination>
                </template>

            </el-main>
            <!--底部-->
            <el-footer>
                <span>© 2019 nglsk www.nglsk.cn</span>
            </el-footer>
        </el-container>
    </el-container>
</div>
<script src="ElementUI/vue.js/"></script>
<script src="ElementUI/index.js"></script>

<script>



    let dataObj = {

        currentPage: 1,
        tableData: [{date: '2016-05-02',
            name: '王小虎',
            province: '上海',
            city: '普陀区',
            address: '上海市普陀区金沙江路 1518 弄',
            zip: 200333
        }, {
            date: '2016-05-04',
            name: '王小虎',
            province: '上海',
            city: '普陀区',
            address: '上海市普陀区金沙江路 1517 弄',
            zip: 200333
        }, {
            date: '2016-05-01',
            name: '王小虎',
            province: '上海',
            city: '普陀区',
            address: '上海市普陀区金沙江路 1519 弄',
            zip: 200333
        }]
    };
    let vm = new Vue({
        el: "#app",  //element,告诉vue要控制的区域
        data: dataObj,
        methods:{
            edit(val){
                console.log(val);
            },
            handleSizeChange(){

            },
            handleCurrentChange(val){
                console.log(val);
            }
        }
    })


</script>
</body>
</html>
